<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%--
  Created by IntelliJ IDEA.
  User: Master
  Date: 2023/2/2
  Time: 9:53
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
    <link rel="stylesheet" href="css/show.css">
    <link rel="stylesheet" href="css/common.css">
</head>
<body>
<input type="button" value="新增" onclick="window.location.href='Add.jsp';">
<div class="zhixian"></div>
<%--${brandModelList[0].id}--%>
<div class="table">
    <div class="justify-content-between table-title">
        <div>序号</div>
        <div>品牌名称</div>
        <div>企业名称</div>
        <div>排序</div>
        <div>品牌介绍</div>
        <div>状态</div>
        <div>操作</div>
    </div>
    <div class="table-content">
        <%--    items="${brandModelList}" 取得Java后台的值  对应req里面的key值
           var="model" 集合里面的对象 对应forEach里面的BrandModel model 名字随便去
           varStatus="" 只是一个状态
           step="3" 步进 隔几个取值
           begin="1" 从第几个开始取
           end="2" 从第几个结束
           --%>
        <%--
        req.setAttribute("brandModelList", brandModelList);
                for (BrandModel model:brandModelList
                     ) {
                    System.out.println(model.getId());
                }
           --%>
        <c:forEach items="${brandModelList}" var="model" varStatus="aa">
            <%--            <c:if test="${aa.}"></c:if>--%>
            <div class="justify-content-between">
                <div>${model.id}</div>
                <div>${model.name}</div>
                <div>${model.enterprise}</div>
                <div>${model.sort}</div>
                <div>${model.introduction}</div>
                <c:if test="${model.status==1}">
                    <div>启用</div>
                </c:if>
                <c:if test="${model.status==0}">
                    <div>禁用</div>
                </c:if>
                <div class="justify-content-center">
                    <div><a href="/go?id=${model.id}">修改</a></div>
                    <div><a href="/delete?id=${model.id}">删除</a></div>
                </div>
            </div>
        </c:forEach>


    </div>
</div>
</body>
</html>
